const Router = require('koa-router')
const {handleError,handleSuccess} = require('../units')
const controller = require("../controller")
let config = require("../config/default.config")
const router = new Router({
    prefix: config.app.root_path
})

router
    .get('/', (ctx, next) => {
        handleSuccess({ctx,data:config.info})
    })
    .get('/user',controller.users.getUsers)
    .post('/login',controller.users.login)
    .post('/resgister',controller.users.resgister)

module.exports = router;
